package com.ztorn.services.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ztorn.dtos.ActionLogDTO;
import com.ztorn.mapper.MyactionLogMapper;
import com.ztorn.model.MyactionLog;
import com.ztorn.services.MyactionLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MyactionLogServiceImpl extends ServiceImpl<MyactionLogMapper, MyactionLog> implements MyactionLogService {

    @Autowired
    private MyactionLogMapper myactionLogMapper;
    @Override
    public boolean save(MyactionLog entity) {
        ActionLogDTO actionLogDTO = myactionLogMapper.getMaxId();
        entity.setActionId(actionLogDTO.getMaxActionId()+1);
        entity.setInvId(actionLogDTO.getMaxInvId()+1);
        return super.save(entity);
    }
}